﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Statement.aspx.cs" Inherits="WMS6.Web.Billing.Statement"
    meta:resourcekey="Page" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Statement</title>
    <link href="../style/zh/1/css.css" type="text/css" rel="Stylesheet" id="mycss" />
    <link href="../Css/style.css" type="text/css" rel="stylesheet" />

    <script src="../Js/jquery.js" type="text/javascript"></script>

    <script src="../Js/jquery.simplemodal.js" type="text/javascript"></script>

    <script src="../Js/util.js" id="js" type="text/javascript"></script>

    <script src="../Js/InitPage.js" type="text/javascript"></script>

    <script src="../Js/Verification.js" type="text/javascript"></script>

    <script src="../Js/checkbox.js" type="text/javascript"></script>

    <script src="../Js/calendar.js" type="text/javascript" charset="gb2312"></script>

    <script type="text/javascript">
        //初始化页面
        window.onload = function() {
            initEditNewPage();
        }
        //弹出窗口选择货主
        function selectOwner() {
            var rtnValue = popModalWindow('../Configuration/OwnerQuery.aspx?action=txtOwnerID', 'dialogWidth=800px;dialogHeight=500px;center=yes;resizable=yes;status=no;');
            if (rtnValue != null && rtnValue.toString() != "") {
                document.getElementById("txtOwnerID").focus();
                document.getElementById("txtOwnerID").value = rtnValue;
            }
        }
        function newStatement() {
            var from = document.getElementById("hdnFrom").value;
            window.location.href = "Statement.aspx?from=" + escape(from);
            return false;
        }


        function confirmMsg(code) {
            if (code == "F9200_001") {
                if (confirm('<%=GetGlobalMsgResource("F9200_001") %>')) {
                    return true;
                }
                else {
                    return false;
                }
            }
            else if (code == "F9200_002") {
            if (confirm('<%=GetGlobalMsgResource("F9200_002") %>')) {
                    return true;
                }
                else {
                    return false;
                }
            }
        }
    </script>

</head>
<body>
    <form id="F9201" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div id="div_top">
            <table>
                <tr>
                    <td valign="bottom">
                        <asp:Label ID="lblOwner" runat="server" CssClass="label_header" Text="对账单" meta:resourcekey="lblOwner"></asp:Label>
                    </td>
                    <td>
                        <asp:Button ID="btnGoBack" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnGoBack%>"
                            Enabled="False" OnClick="btnGoBack_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnRun" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnRun%>"
                            Enabled="False" AccessKey="n" OnClick="btnRun_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnConfirm" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnConfirm%>"
                            Enabled="False" AccessKey="s" OnClientClick="javascript:if(confirmMsg('F9200_001')) return true; else return false;"
                            OnClick="btnConfirm_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnPay" runat="server" CssClass="button" Text="<%$Resources:ButtonResource,btnPay%>"
                            Enabled="False" AccessKey="d" OnClientClick="javascript:if(confirmMsg('F9200_002')) return true; else return false;"
                            OnClick="btnPay_Click" />
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
        </div>
        <asp:UpdatePanel ID="up1" runat="server">
            <ContentTemplate>
                <div>
                    <asp:Label ID="lblMsg" runat="server" CssClass="label_message" meta:resourcekey="lblMsg"></asp:Label>
                </div>
                <div id="div_menu">
                    <div style="float: left; width: 8px;">
                        <div class="tabL" id="divL1">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur" onclick="setTab('one',1,2)"
                        id="divM1">
                        <asp:Label ID="one1" CssClass="hover" runat="server" meta:resourcekey="one1">基本信息</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR" id="divR1">
                        </div>
                    </div>
                    <div style="float: left; width: 8px;">
                        <div class="tabL_1" id="divL2">
                        </div>
                    </div>
                    <div style="float: left;" class="tabLabelCont tabCur_1" onclick="setTab('one',2,2);"
                        id="divM2">
                        <asp:Label ID="one2" CssClass="navigationlabel" runat="server" meta:resourcekey="one2">&nbsp;对账单明细&nbsp;</asp:Label></div>
                    <div style="float: left; margin-right: 2px;">
                        <div class="tabR_1" id="divR2">
                        </div>
                    </div>
                </div>
                <div id="div_content">
                    <div id="con_one_1" style="display: block;">
                        <table width="720px" style="margin-left: 10px; margin-top: 10px;">
                            <tr>
                                <td width="180">
                                    <asp:Label ID="lblStatementID" runat="server" CssClass="label" Text="对账单编号" meta:resourcekey="lblStatementID"></asp:Label><span
                                        class="must_input">*</span>
                                </td>
                                <td width="180">
                                    <asp:Label ID="Label1" runat="server" CssClass="label" Text="货主" meta:resourcekey="Label1"></asp:Label><span
                                        class="must_input">*</span>
                                </td>
                                <td width="180">
                                </td>
                                <td width="180">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtStatementID" runat="server" CssClass="textbox" MaxLength="20"
                                        meta:resourcekey="txtStatementID"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtOwnerID" runat="server" CssClass="textbox" meta:resourcekey="txtOwnerID"></asp:TextBox><img
                                        src="../Images/icon_find.gif" id="imgOwnerID" runat="server" alt="select one item"
                                        class="img" onclick="selectOwner();" />
                                </td>
                                <td>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="180">
                                    <asp:Label ID="lblStatus" runat="server" CssClass="label" Text="状态" meta:resourcekey="lblStatus"></asp:Label>
                                </td>
                                <td width="180">
                                    <asp:Label ID="lblEndTime" runat="server" CssClass="label" Text="截止日期" meta:resourcekey="lblEndTime"></asp:Label><span
                                        class="must_input">*</span>
                                </td>
                                <td width="180">
                                </td>
                                <td width="180">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:DropDownList ID="ddlStatus" runat="server" CssClass="mediumselectbox" Enabled="False"
                                        meta:resourcekey="ddlStatus">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEndTime" runat="server" CssClass="textbox" meta:resourcekey="txtEndTime"></asp:TextBox><img
                                        src="../Images/calendar.gif" class="img" alt="请选择日期" onclick="setday(this,txtEndTime);" />
                                </td>
                                <td>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td width="180">
                                    <asp:Label ID="lblStatementDate" runat="server" CssClass="label" Text="对账日期" meta:resourcekey="lblStatementDate"></asp:Label>
                                </td>
                                <td width="180">
                                    <asp:Label ID="lblPaymentDate" runat="server" CssClass="label" Text="付款日期" meta:resourcekey="lblPaymentDate"></asp:Label>
                                </td>
                                <td width="180">
                                </td>
                                <td width="180">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtStatementDate" runat="server" CssClass="textbox" MaxLength="20"
                                        Enabled="False" meta:resourcekey="txtStatementDate"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPaymentDate" runat="server" CssClass="textbox" MaxLength="20"
                                        Enabled="False" meta:resourcekey="txtPaymentDate"></asp:TextBox>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td width="180">
                                    <asp:Label ID="lblTotalReceivable" runat="server" CssClass="label" Text="总应收" meta:resourcekey="lblTotalReceivable"></asp:Label>
                                </td>
                                <td width="180">
                                    <asp:Label ID="lblTotalReceived" runat="server" CssClass="label" Text="总实收" meta:resourcekey="lblTotalReceived"></asp:Label>
                                </td>
                                <td width="180">
                                </td>
                                <td width="180">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtTotalReceivable" runat="server" CssClass="textbox" Enabled="False"
                                        meta:resourcekey="txtTotalReceivable"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtTotalReceived" runat="server" CssClass="textbox" Enabled="False"
                                        meta:resourcekey="txtTotalReceived"></asp:TextBox>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td width="180">
                                    <asp:Label ID="lblRemark" runat="server" CssClass="label" Text="备注" meta:resourcekey="lblRemark"></asp:Label>
                                </td>
                                <td width="180">
                                </td>
                                <td width="180">
                                </td>
                                <td width="180">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:TextBox ID="txtRemark" runat="server" CssClass="largetextbox" meta:resourcekey="txtRemark"></asp:TextBox>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="chkInBound" runat="server" CssClass="checkbox" Text="入库费" Checked="True"
                                        meta:resourcekey="chkInBound" />
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="chkOutBound" runat="server" CssClass="checkbox" Text="出库费" Checked="True"
                                        meta:resourcekey="chkOutBound" />
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="chkInventory" runat="server" CssClass="checkbox" Text="仓储费" Checked="True"
                                        meta:resourcekey="chkInventory" />
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:CheckBox ID="chkAccessorial" runat="server" CssClass="checkbox" Text="附加费" Checked="True"
                                        meta:resourcekey="chkAccessorial" />
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="con_one_2" style="display: none;">
                        <table width="1100px" style="margin-left: 10px; margin-top: 10px;">
                            <tr style="height: 10px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div>
                                        <asp:GridView ID="gvStatementDetail" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                                            CssClass="gridview" OnRowDataBound="gvStatementDetail_RowDataBound" DataKeyNames="LineID"
                                            AllowPaging="True" OnPageIndexChanging="gvStatementDetail_PageIndexChanging" oninit="gvStatementDetail_Init" 
                                            OnSorting="gvStatementDetail_Sorting" meta:resourcekey="gvStatementDetail">
                                            <FooterStyle CssClass="GridViewFooterStyle" />
                                            <RowStyle CssClass="GridViewRowStyle" />
                                            <HeaderStyle CssClass="GridViewHeaderStyle" />
                                            <PagerStyle CssClass="GridViewPageStyle" />
                                            <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                            <Columns>
                                                <asp:BoundField HeaderText="序号" FooterText="序号" meta:resourcekey="No">
                                                    <ItemStyle CssClass="GridViewRowWidth_40" />
                                                </asp:BoundField>
                                                <asp:TemplateField HeaderText="明细" FooterText="明细" meta:resourcekey="TemplateField">
                                                    <ItemTemplate>
                                                        <a href='<%# FormatUrl("StatementDetail.aspx?from={0}&ID={1}&LineID={2}&type=Edit",this.hdnFrom.Value,this.txtStatementID.Text,Eval("LineID").ToString()) %>'
                                                            target="_self">
                                                            <img src="../Images/icon_edit.gif" class="img" style="border: none 0px blue;" alt="receipt" /></a>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_50" HorizontalAlign="Center" />
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="LineID" HeaderText="行号" FooterText="行号" SortExpression="LineID"
                                                    meta:resourcekey="LineID">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="OrderID" HeaderText="单据号" FooterText="单据号" SortExpression="OrderID"
                                                    meta:resourcekey="OrderID">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="OrderLineID" HeaderText="单据行号" FooterText="单据行号" SortExpression="OrderLineID"
                                                    meta:resourcekey="OrderLineID">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="Type" HeaderText="费用类型" FooterText="费用类型" SortExpression="Type"
                                                    meta:resourcekey="Type">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="SourceType" HeaderText="来源类型" FooterText="来源类型" SortExpression="SourceType"
                                                    meta:resourcekey="SourceType">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="SkuID" HeaderText="货品" FooterText="货品" SortExpression="SkuID"
                                                    meta:resourcekey="SkuID">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="Qty" HeaderText="数量" FooterText="数量" SortExpression="SkuID"
                                                    meta:resourcekey="Qty">
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:BoundField>
                                                <asp:TemplateField FooterText="应收" HeaderText="应收" SortExpression="Receivable" meta:resourcekey="Receivable">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblReceivable" runat="server" Text='<%# GetPreferenceDigit(Eval("Receivable").ToString()) %>'
                                                            meta:resourcekey="lblReceivable"></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:TemplateField>
                                                <asp:TemplateField FooterText="实收" HeaderText="实收" SortExpression="Received" meta:resourcekey="Received">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblReceived" runat="server" Text='<%# GetPreferenceDigit(Eval("Received").ToString()) %>'
                                                            meta:resourcekey="lblReceived"></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_100" />
                                                </asp:TemplateField>
                                                <asp:TemplateField FooterText="备注" HeaderText="备注" SortExpression="REMARK" meta:resourcekey="REMARK">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblRemark" runat="server" Text='<%# Eval("REMARK").ToString() %>'
                                                            meta:resourcekey="lblRemarkResource2"></asp:Label>
                                                    </ItemTemplate>
                                                    <ItemStyle CssClass="GridViewRowWidth_200" />
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr style="height: 30px;">
                                <td>
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <input type="hidden" id="hdnFlag" runat="server"></input>
                    <input id="hdnLineID" runat="server" type="hidden"></input>
                    <input id="hdnStatementID" runat="server" type="hidden"></input>
                
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <input type="hidden" id="hdnFrom" runat="server" />
    <input type="hidden" id="hdncalendarFlag" runat="server" />
    <input type="hidden" id="hdnDataFormat" runat="server" />
    </form>
</body>
</html>

<script language="javascript" type="text/javascript" event="onclick" for="document">
		<!--
		 hiddenCalendarDiv();
		//-->
</script>

